package com.longxi.tianjintianbao.ui.activity.energy_read;

import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.widget.EditText;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.energy_read.EnergyWriteListAtPresenter;
import com.longxi.tianjintianbao.ui.view.energy_read.IEnergyWriteListAtView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;

import butterknife.BindView;

public class EnergyWriteListActivity extends BaseActivity<IEnergyWriteListAtView, EnergyWriteListAtPresenter> implements IEnergyWriteListAtView {

    private final String TAG = "EnergyWriteListActivity";

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_energy_write_list;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();
        mPresenter.initAdapter();
        mPresenter.getMetersList();
    }

    @Override
    public void initListener() {
        super.initListener();
    }

    @Override
    protected EnergyWriteListAtPresenter createPresenter() {
        return new EnergyWriteListAtPresenter(this);
    }

    @Override
    public SmartRefreshLayout getRefreshLayout() {
        return mRefreshLayout;
    }

    @Override
    public RecyclerView getRvContent() {
        return mRvContent;
    }

    public void refreshReceiptList() {
        mRefreshLayout.autoRefresh();
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(RESULT_OK != resultCode){
            return;
        }
    }

    @Override
    protected void onDestroy() {
        mPresenter.onDestroy();
        super.onDestroy();
    }
}
